package cn.yunhe.service.impl;

import cn.yunhe.dao.INewsDao;
import cn.yunhe.entity.News;
import cn.yunhe.entity.Page;
import cn.yunhe.service.INewsService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("newsService")
public class NewsServiceImpl implements INewsService {

    @Resource
    private INewsDao newsDao;

    @Override
    public List<News> getAllNews() {
        return newsDao.getAllNews();
    }

    @Override
    public Page getNewsByPage(int pageNum, int pageSize) {
        return newsDao.getNewsByPage(pageNum, pageSize);
    }

    public INewsDao getNewsDao() {
        return newsDao;
    }

    public void setNewsDao(INewsDao newsDao) {
        this.newsDao = newsDao;
    }
}
